package demo4;

import demo2.Money;

public class Student implements Cloneable{
        public int age;
        public String  name;
       public Money money = new Money(9.9);
        public Student(int age, String name) {
            this.age = age;
            this.name = name;
        }

        @Override
        public String toString() {
            return "demo4.Student{" +
                    "age=" + age +
                    ", name='" + name + '\'' +
                    '}';
        }


        @Override
        protected Object clone() throws CloneNotSupportedException {
            Student tem = (Student) super.clone();
            tem.money = (Money) this.money.clone();
            return tem;
        }
    }

